﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <Style x:Key="CanvasStyle" TargetType="Canvas">
        <Setter Property="Background">
            <Setter.Value>
                <DrawingBrush  Viewport="0,0,50,50" ViewportUnits="Absolute" TileMode="Tile">
                    <DrawingBrush.Drawing>
                        <DrawingGroup>
                            <GeometryDrawing Brush="LightYellow">
                                <GeometryDrawing.Geometry>
                                    <RectangleGeometry Rect="0,0,1,1" />
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                            <GeometryDrawing Geometry="M0,0 L1,0 1,0.01, 0,0.01Z " Brush="#CCCCFF" />
                            <GeometryDrawing Geometry="M0,0 L0,1 0.01,1, 0.01,0Z" Brush="#CCCCFF" />
                        </DrawingGroup>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style> 
    <Style x:Key="ButtonStyle" TargetType="Label">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Lucida Handwriting"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <Border BorderBrush="Brown" BorderThickness="4">
                        <Border Background="LightYellow" >
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CheckBoxStyle" TargetType="CheckBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Lucida Handwriting"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    

                        <BulletDecorator 
            Margin="4,0,0,0"            
            HorizontalAlignment="Stretch" 
            VerticalAlignment="Center" 
            Width="Auto" 
            Height="Auto">
                            
                            <BulletDecorator.Bullet>
                                <Border x:Name="Border"  
              Width="15" 
              Height="15" 
                                        VerticalAlignment="Center" 
            HorizontalAlignment="Stretch"
              CornerRadius="0" 
              Background="LightYellow"
              BorderThickness="3"
              BorderBrush="Brown"  >
                                    <Path 
                Width="7" Height="7" 
                x:Name="CheckMark"
                SnapsToDevicePixels="False" 
                Stroke="Brown"
                StrokeThickness="2"
                Data="M 0 0 L 7 7 M 0 7 L 7 0" />

                                </Border>
                            </BulletDecorator.Bullet>
                            <ContentPresenter Margin="4,0,0,0"
            VerticalAlignment="Top"
            HorizontalAlignment="Left"
                                              Width="Auto" Height="Auto"/>
                        </BulletDecorator>
                    

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>